(function($){
    $.fn.validationEngineLanguage = function(){
    };
    $.validationEngineLanguage = {
        newLang: function(){
            $.validationEngineLanguage.allRules = {
                "required": {    			// Add your regex rules here, you can take telephone as an example
						"regex":"none",
						"alertText":"* 此栏为必填项",
						"alertTextCheckboxMultiple":"* 请选择一个选项",
						"alertTextCheckboxe":"* 此选择框为必选"
						},
                "minSize": {
                    "regex": "none",
                    "alertText": "* 最小长度 ",
                    "alertText2": " 最少字符要求"
                },
                "maxSize": {
                    "regex": "none",
                    "alertText": "* 最大长度 ",
                    "alertText2": " 最大允许输入字符数"
                },
                /**
                 * 身份证校验规则
                 * @author 张彬
                 * @Date 2011-12-26
                 */
                "idCard": {
                    "regex": "none",
                    "alertText": "* 身份证位数不正确 ",
                    "alertText1": "* 身份证号码出生日期超出范围或含有非法字符",
                    "alertText2": "* 身份证号码校验错误",
                    "alertText3": "* 身份证地区非法"
                    
                },
				"groupRequired": {
                    "regex": "none",
                    "alertText": "* 你必须填写下面其中一个字段"
                },
                "min": {
                    "regex": "none",
                    "alertText": "* 最小值是 "
                },
                "max": {
                    "regex": "none",
                    "alertText": "* 最大值是 "
                },
                "past": {
                    "regex": "none",
                    "alertText": "* 过期的日期 "
                },
                "future": {
                    "regex": "none",
                    "alertText": "* 未到的日期 "
                },	
                /**
                 * 预约时间校验规则
                 * @author 张彬
                 * @Date 2011-12-26
                 */
                "checkDate": {
                	"regex": "none",
                	"alertText" : "* 只能预约大于 ",
                	"alertText2": " 的日期"
                },
                "maxCheckbox": {
                    "regex": "none",
                    "alertText": "* 最大选择 ",
                    "alertText2": " 合法的选项"
                },
                "minCheckbox": {
                    "regex": "none",
                    "alertText": "* 请选择 ",
                    "alertText2": " 选项"
                },
                "equals": {
                    "regex": "none",
                    "alertText": "* 字段值不匹配"
                },
                "phone": {
                    // credit: jquery.h5validate.js / orefalo
                    "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
                    "alertText": "* 不是合法的电话号码"
                },
                "email": {
                    // Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/
                    "regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
                    "alertText": "* 不是合法的邮箱地址"
                },
                "integer": {
                    "regex": /^[\-\+]?\d+$/,
                    "alertText": "* 不是合法的整数"
                },
                "number": {
                    // Number, including positive, negative, and floating decimal. credit: orefalo
                    "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/,
                    "alertText": "* 不合法的小数"
                },
                "date": {
                    "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
                    "alertText": "* 不合法的日期,必须类似 YYYY-MM-DD 的格式"
                },
                "ipv4": {
                    "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
                    "alertText": "* 不合法的IP地址"
                },
                "url": {
                    "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,
                    "alertText": "* 不合法的路径"
                },
                "onlyNumberSp": {
                    "regex": /^[0-9\ ]+$/,
                    "alertText": "* 只能输入数字"
                },
                "onlyLetterSp": {
                    "regex": /^[a-zA-Z\ \']+$/,
                    "alertText": "* 只能输入英文字母"
                },
                "onlyLetterNumber": {
                    "regex": /^[0-9a-zA-Z]+$/,
                    "alertText": "* 不允许输入特殊字符串"
                },
                // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
                /**
                 * 系统用户帐号校验
                 * @param url 系统用户帐号校验action
                 * @param alertTextOk 帐号可用提示
                 */
                "ajaxUserCall": {
                    "url": "SysUser!checkName",
                    // you may want to pass extra data on the ajax call
                    "extraData": "name=eric",
                    "alertTextOk": "* 恭喜你，此用户名可以使用",
                    "alertText": "* 该用户名已经存在",
                    "alertTextLoad": "* 正在验证中，请稍等..."
                },
				"ajaxUserCallPhp": {
                    "url": "phpajax/ajaxValidateFieldUser.php",
                    // you may want to pass extra data on the ajax call
                    "extraData": "name=eric",
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "* 恭喜你，此用户名可以使用",
                    "alertText": "* 该用户名已经存在",
                    "alertTextLoad": "* 正在验证中，请稍等..."
                },
                //judge the mobile number is right
                "mobile":{
                	"regex": /^0{0,1}(13[0-9]|15[0-9]|18[0-9])[0-9]{8}$/,
                	 "alertText": "* 您输入的手机号码不对，请重新输入.."
                },
                /**
                 * 用户名校验
                 * @param url 用户名校验action
                 */
                "ajaxUserNameCall": {
                    // remote json service location
                    "url": "Sys/Register",
                    // error
                    "alertText": "* 该名称已经存在",
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "* 恭喜你，这个名称可以使用",
                    // speaks by itself
                    "alertTextLoad": "* 正在验证中，请稍等..."
                },
                /**
                 * 系统代码英文名校验
                 * @param url 系统代码英文名校验action
                 */
                "ajaxNameCall": {
                    // remote json service location
                    "url": "SysCode!checkEnName",
                    // error
                    "alertText": "* 该名称已经存在",
                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
                    "alertTextOk": "* 恭喜你，这个名称可以使用",
                    // speaks by itself
                    "alertTextLoad": "* 正在验证中，请稍等..."
                },
                /**
                 * 患者身份证校验
                 * @param url 系统用户帐号校验action
                 * @param alertTextOk 帐号可用提示
                 */
                "ajaxIDCardCall": {
                    "url": "/mis/Base/Patient!checkIDCard",
                    // you may want to pass extra data on the ajax call
                    "extraData": "name=eric",
                    "alertTextOk": "* 恭喜你，此证件号码可以使用",
                    "alertText": "* 该证件号码已经存在",
                    "alertTextLoad": "* 正在验证中，请稍等..."
                },
                /**
                 * 专家身份证校验
                 * @param url 系统用户帐号校验action
                 * @param alertTextOk 帐号可用提示
                 */
                "ajaxCardIdCall": {
                    "url": "/mis/Base/Person!checkCardId",
                    // you may want to pass extra data on the ajax call
                    "extraData": "name=eric",
                    "alertTextOk": "* 恭喜你，此身份证号可以使用",
                    "alertText": "* 该身份证号已经存在",
                    "alertTextLoad": "* 正在验证中，请稍等..."
                },
				 "ajaxNameCallPhp": {
	                    // remote json service location
	                    "url": "phpajax/ajaxValidateFieldName.php",
	                    // error
	                    "alertText": "* 该名称已经存在",
	                    // speaks by itself
	                    "alertTextLoad": "* 正在验证中，请稍等..."
	                },
                "validate2fields": {
                    "alertText": "* 请输入HELLO"
                },
	            //tls warning:homegrown not fielded 
                "dateFormat":{
                    "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/,
                    "alertText": "* 非法的日期格式"
                },
                //tls warning:homegrown not fielded 
				"dateTimeFormat": {
	                "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/,
	                "alertText": "* 非法的日期格式\n必须是类似如下的日期格式: mm/dd/yyyy hh:mm:ss AM|PM or yyyy-mm-dd hh:mm:ss AM|PM"
	            }
            };
            
        }
    };
    $.validationEngineLanguage.newLang();
})(jQuery);